<?php
/**
 * Created by PhpStorm.
 * User: dream
 * Date: 2017/8/20
 * Time: 14:28
 */
class Home extends MY_Controller
{

    public function index()
    {
        $user = $this->session("user");

        $this->loadHelper("url");
        $this->loadView(ADMIN . "home/home_index",compact('user'));
    }

    //退出
    public function logout()
    {
        $this->loadModel("usereventinfo");
        $res = $this->usereventinfo->add_event_log(UserEventInfo::EVENT_LOGOUT,$this->time());

        $this->loadLibrary("session");
        $this->loadHelper("url");
        $this->session->sess_destroy();
        $this->redirect(web_url('login',true));
    }


}